The present disclosure relates to efficient context save/restore during hardware decompression of deflate encoded data. More particularly, the present disclose relates to using mid-stream restore commit points to efficiently restore a data stream that was interrupted during a previous decompression session.
Computer systems compress data for various reasons, such as to reduce storage requirements or to reduce bandwidth requirements when sending data over a computer network. One approach to compress data is referred to as “DEFLATE”. Deflate is a data compression algorithm that uses a combination of an LZ77 algorithm and Huffman coding to compress data. Deflate data streams include a series of “deflate blocks,” which includes a header, Huffman encoded deflate elements, and an Huffman encoded end of block element. A particular deflate block's header includes information to configure a decompression engine such that the decompression engine correctly decompresses each Huffman element in the particular deflate block. As a result, for each deflate block, the decompression engine is reconfigured based upon the header of the deflate block. The deflate blocks may be static deflate blocks (use static Huffman encoding), dynamic deflate blocks (includes a Huffman tree in the header), or non-compressed blocks with varying sizes.